package org.springblade.modules.api.task;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.modules.api.service.ApiService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;


/**
 * JXC 组织机构每半小时同步一次
 * 本系统已有的则修改，没有的则新增
 */
@Service
@AllArgsConstructor
@Slf4j
public class JxcDeptSchedulingTask {
	private ApiService apiService;

	@Scheduled(cron = "30 0/30 * * * ? ")
	public void task(){
		long startTime=System.currentTimeMillis();
		log.info("JXC-组织机构任务调度开始....");
		apiService.getApiDept();
		log.info("JXC-组织机构任务调度结束,耗时{}毫秒",System.currentTimeMillis()-startTime);
	}
}
